﻿FROM node:14.20.0-bullseye-slim as node-build
WORKDIR /web/src
ARG NPM_REGISTRY=https://registry.npm.taobao.org/

RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update &&  apt-get install -y python g++ build-essential && rm -rf /var/lib/apt/lists/*

# RUN yarn config set registry ${NPM_REGISTRY}
COPY package.json .
COPY yarn.lock .
RUN yarn --registry ${NPM_REGISTRY}
COPY . .
RUN yarn build:prod
